<!DOCTYPE html>
<html>
    
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
        <title>$.fn.parent</title>
        <script>
            window.$$path = location.protocol + "//" + location.host;
            document.write('<script src="' + $$path + '/mass_merge.js"><\/script>')
            document.write('<script src="' + $$path + '/doc/scripts/common.js"><\/script>')
        </script>
    </head>
    
    <body>
        <article>
            <h3>$.fn.parent([ expr ])</h3>
            <p>
                <span class="stress">描述：</span>
            </p>
            <p>把匹配元素的父元素收集起来，去重排序组成新mass实例返回。</p>
            <p>
                <span class="stress">参数：</span>
            </p>
            <dl>
                <dt>expr</dt>
                <dd>可选，String，用于进一步过滤的CSS选择器。</dd>
            </dl>
            <p>
                <span class="stress">返回值：</span>
            </p>
            <p>新mass实例</p>
            <fieldset>
                <legend>例子</legend>
                <p>显示.sample1的所有孩子的层次关系</p>
                <div class="sample1" style="background:#ffe0bb;color:#000;">
                    <div>div,
                        <span>span,</span>
                        <b>b</b>
                    </div>
                    <p>p,
                        <span>span,
                            <em>em</em>
                        </span>
                    </p>
                    <div>div,
                        <strong>strong,
                            <span>span,</span>
                            <em>em,
                                <b>b,</b>
                            </em>
                        </strong>
                        <b>b</b>
                    </div>
                </div>
                <pre class="brush:xml;gutter:false;toolbar:false">

    <div class="sample1" style="background:#ffe0bb;color:#000;">
        <div>div,
            <span>span, </span>
            <b>b </b>
        </div>
        <p>p,
            <span>span,
                <em>em </em>
            </span>
        </p>

        <div>div,
            <strong>strong,
                <span>span, </span>
                <em>em,
                    <b>b, </b>
                </em>

            </strong>
            <b>b </b>
        </div>
    </div>
    
</pre>
                <pre class="brush:javascript;gutter:false;toolbar:false">
$.require("ready,node", function() {
    $(".sample1 *").each(function() {
        var parentTag = $(this).parent()[0].tagName.toLowerCase();
        $(this).prepend(document.createTextNode(parentTag + " > "));
    });
});
</pre>
                <button class="doc_btn" type="button">点我，执行代码</button>
            </fieldset>
        </article>
    </body>

</html>